home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import sys
- import traceback
- _debug = False
-
- def debugprint(x):
- if _debug:
-
- try:
- print >>sys.stderr, x
-
-
-
-
- def get_debugging():
- return _debug
-
-
- def set_debugging(d):
- global _debug
- _debug = d
-
-
- def fatalException(exitcode = 1):
- nonfatalException(type = 'fatal', end = 'Exiting')
- sys.exit(exitcode)
-
-
- def nonfatalException(type = 'non-fatal', end = 'Continuing anyway..'):
- d = get_debugging()
- set_debugging(True)
- debugprint('Caught %s exception. Traceback:' % type)
- (type, value, tb) = sys.exc_info()
- tblast = traceback.extract_tb(tb, limit = None)
- if len(tblast):
- tblast = tblast[:len(tblast) - 1]
-
- extxt = traceback.format_exception_only(type, value)
- for line in traceback.format_tb(tb):
- debugprint(line.strip())
-
- debugprint(extxt[0].strip())
- debugprint(end)
- set_debugging(d)
-
-